<%-- 
    Document   : admin-editcategoryBody
    Created on : Apr 28, 2011, 9:18:35 PM
    Author     : Roaa
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="ds" uri="/WEB-INF/tlds/displaycategories.tld" %>
<%@taglib  uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Edit Category</title>
    </head>
    <body>
        <div id="page-body">
            <html:form action="admCategory?actionType=saveCatChanges" >

                <h2>Edit category >></h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <br />
                <bean:define id="cat" name="admCategoryBean" property="category"></bean:define>
                <bean:define id="nam" name="cat" property="name"></bean:define>
                <bean:define id="des" name="cat" property="description"></bean:define>
                <bean:define id="catID" name="cat" property="categoryId"></bean:define>
                <table width="40%">
                    <tr>
                        <td>Name:</td>
                        <td><html:text property="name" value="${nam}"></html:text></td>
                    </tr>
                    <tr>
                        <td>Description:</td>
                        <td>
                            <html:text property="desc" value="${des}"></html:text>
                            <html:hidden property="catId" value="${catID}" />
                        </td>
                    </tr>
                    
                </table>
                <html:submit value="Apply Changes"></html:submit>
            </html:form>
            <html:form action="admCategory?actionType=deleteForums" >
                <html:hidden property="catId" value="${catID}" />
                <table width="25%">
                    <tr>
                        <td colspan="2">
                            <br /><h3>Forums: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="admForum.do?actionType=addForum">Add Forum >></a></h3>
                            
                        </td>
                    </tr>
                    <logic:iterate id="forum" name="cat" property="forums">
                        <tr>
                            <td align="center"><html:multibox property="selected"><bean:write name="forum" property="forumId" /></html:multibox></td>
                            <td align="left"><h4><bean:write name="forum" property="name"/></h4></td>
                            <td><a href="admForum.do?actionType=editForum&forumId=<bean:write name="forum" property="forumId" />">Edit</a></td>
                        </tr>
                    </logic:iterate>

                </table>
                <html:submit value="Delete Selected"></html:submit>

            </html:form>
        </div>
    </body>
</html>